<template>
  <div>
    <SkyPanel title="服务类别信息列表">

      <template v-slot:header>
        <img style="width:16px" src="~@/assets/images/panel-error.png" alt="">
        <span>（至少添加一条服务类别信息且资料完整度为100%才可发起入库）</span>
      </template>

      <template v-slot:main>

        <div class="module-tb-container" v-for="(item,index) in infoList" :key="index">
          <div class="serial">
            {{index+1}}
          </div>
          <div style="width:200px">
            <div class="th">服务类别</div>
            <div class="td">{{item.name}}</div>
          </div>
          <div style="flex:1">
            <div class="th">申请入库公司</div>
            <div class="td">{{item.company}}</div>
          </div>
          <div style="width:200px">
            <div class="th">入库检测</div>
            <div class="td detection" v-if="item.state==1">
              <img src="~@/assets/images/success-logo.png" alt="">
              <div style="color:#00B87A">通过</div>
              <img src="~@/assets/images/search-logo.png" alt="">
            </div>
            <div class="td detection" v-if="item.state==0">
              <img src="~@/assets/images/panel-error.png" alt="">
              <div style="color:#FF0014">未通过</div>
              <img src="~@/assets/images/search-logo.png" alt="">
            </div>
          </div>
          <div style="width:200px">
            <div class="th">申请状态</div>
            <div class="td detection">
              <img src="~@/assets/images/warning-logo.png" alt="">
              <div style="color:#FF8800">未发起</div>
            </div>
          </div>
          <div>
            <div class="th">操作</div>
            <div class="td operation">
              <div>申请入库</div>
            </div>
          </div>
        </div>

        <div class="module-add">
          <img src="~@/assets/images/module-add.png" alt="">
          <span>新增服务类别</span>
        </div>

      </template>
    </SkyPanel>
  </div>
  <div class="footer">
    <el-button @click="prestep">上一步</el-button>
    <el-button type="primary" @click="submitForm">保存</el-button>

  </div>
</template>

<script lang="ts">
  import { defineComponent } from "vue";
  import { useRouter } from "vue-router";

  export default defineComponent({
    data() {
      return {
        infoList: [
          {
            name: "造价资讯",
            company: "江苏区域集团",
            state: 1,
          },
          {
            name: "勘察工程",
            company: "上海区域集团",
            state: 0,
          },
        ],
        value2: "",
      };
    },
    methods: {
      prestep() {
        this.$parent.active = 4;
      },
    },
    setup() {
      const router = useRouter();
      const submitForm = () => {
        alert("保存成功,查看信息");
        router.push("/Home");
      };

      return {
        submitForm,
      };
    },
  });
</script>


<style lang="scss" scoped>
.module-tb-container {
  width: 100%;
  min-height: 50px;
  background: #f6f8fa;
  opacity: 1;
  display: flex;
  padding: 14px 24px;
  margin-bottom: 14px;
  align-items: center;
  .th {
    height: 20px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 20px;
    color: #666666;
    margin-bottom: 15px;
  }
  .td {
    height: 22px;
    font-size: 16px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 22px;
    color: #000000;
  }
  & > div {
    padding: 0 10px;
  }
  .serial {
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    background: #dfeefb;
    border-radius: 50%;
    opacity: 1;
    font-size: 16px;
    font-family: PingFang SC;
    font-weight: 400;
    color: #1890ff;
    margin-right: 30px;
  }
  .operation {
    display: flex;
    & > div {
      margin-right: 10px;
      font-size: 14px;
      font-size: 16px;
      font-family: PingFang SC;
      font-weight: 400;
      color: #1890ff;
      cursor: pointer;
    }
  }
  .detection {
    display: flex;
    align-items: center;
    & > img {
      width: 18px;
      height: 18px;
      margin-right: 5px;
    }
    & > div {
      margin-right: 5px;
    }
  }
}

.module-add {
  display: flex;
  line-height: 50px;
  align-items: center;
  color: #1890ff;
  cursor: pointer;
  & > img {
    width: 20px;
    height: 20px;
    margin-right: 5px;
  }
}

.footer {
  height: 60px;
  width: 1164px;
  position: fixed;
  bottom: 0;
  background: white;
  z-index: 10;
  text-align: right;
  line-height: 60px;
}
</style>